<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>vue</title>
    <style type="text/css">
      /* .v-enter-active, .v-leave-active {
		  transition: opacity 0.5s
		}
		.v-enter, .v-leave-to .fade-leave-active in below version 2.1.8 {
		  opacity: 0
		} */

      /* 使用自定义的类名 */
      .fade-enter-active,
      .fade-leave-active {
        transition: opacity 0.5s;
      }
      .fade-enter, .fade-leave-to /* .fade-leave-active in below version 2.1.8 */ {
        opacity: 0;
      }
    </style>
  </head>
  <script src="./vue.js"></script>
  <body>
    <!-- 模板 -->
    <div id="example">
      <button v-on:click="show = !show">
        Toggle
      </button>

      <transition name="fade">
        <p v-if="show">hello</p>
      </transition>
    </div>

    <script>
      //vm实例
      var vm = new Vue({
        el: '#example',
        data: {
          show: true
        }
      })
    </script>
  </body>
</html>
